/*
 * @Author       : Thyssen Wen
 * @Date         : 2022-09-14 13:46:26
 * @LastEditors  : Thyssen Wen
 * @LastEditTime : 2022-09-14 14:02:04
 * @Description  : CharDisplay Class
 * @FilePath     : /cdesign-pattern/Template/CharDisplay.h
 */
#pragma once
#include "AbstractDisplay.h"
#include <cstring>
#include <iostream>

using namespace std;
class CharDisplay: public AbstractDisplay
{
private:
    char ch;
public:
    CharDisplay(char ch);
    ~CharDisplay();

    void open();
    void print();
    void close();
};

CharDisplay::CharDisplay(char ch)
{
    this->ch = ch;
}

CharDisplay::~CharDisplay()
{
}

void CharDisplay::open()
{
    cout << "<<";
}

void CharDisplay::print()
{
    cout << this->ch;
}

void CharDisplay::close()
{
    cout << ">>" << endl;
}
